require("common/vendor.js"), (global.webpackJsonp = global.webpackJsonp || []).push([ [ "xg_o2o/personnel/personnel_order" ], {
    "0163": function(e, t, n) {},
    "504d": function(e, t, n) {
        "use strict";
        (function(e) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var r = n("9e42"), o = {
                data: function() {
                    return {
                        graceFullLoading: !0,
                        isRush: 2,
                        menuList: [],
                        bottomColor: "",
                        orderItemList: [],
                        scrollLeft: "c0",
                        tabCurrentIndex: 0,
                        attach: "",
                        perid: 0,
                        loadingData: [],
                        ordernum: 0,
                        tempItem: [],
                        clickNum: [],
                        page: [],
                        pageMore: [],
                        tempPageMore: 0,
                        userWxInfo: {},
                        tip: "请等待",
                        showBack: !1,
                        cardName: "次卡"
                    };
                },
                onLoad: function(e) {
                    var t = getCurrentPages();
                    this.showBack = t.length > 1, e.ordernum && (this.tabCurrentIndex = e.ordernum, 
                    this.ordernum = e.ordernum), this.getMenu();
                },
                onShow: function() {
                    1 == e.getStorageSync("topersonnel") && (e.removeStorageSync("topersonnel"), this.tabCurrentIndex = 0, 
                    this.ordernum = 0, this.getMenu());
                },
                methods: {
                    floatAdd: function(e, t) {
                        var n, r, o;
                        try {
                            n = e.toString().split(".")[1].length;
                        } catch (e) {
                            n = 0;
                        }
                        try {
                            r = t.toString().split(".")[1].length;
                        } catch (e) {
                            r = 0;
                        }
                        return o = Math.pow(10, Math.max(n, r)), Number(Math.round(e * o + t * o) / o);
                    },
                    toSetting: function() {
                        var t = this;
                        e.openSetting({
                            success: function(n) {
                                1 == n.authSetting["scope.userLocation"] ? (console.log("重新地址授权"), t.getaddress()) : e.showToast({
                                    title: "打开失败,请重新点击",
                                    icon: "none"
                                });
                            },
                            fail: function(e) {
                                console.log(e);
                            }
                        });
                    },
                    uploadLBS: function() {
                        var t = this;
                        e.getSetting({
                            success: function(n) {
                                n.authSetting["scope.userLocation"] ? 0 == n.authSetting["scope.userLocation"] ? (t.graceFullLoading = !1, 
                                t.$refs.ShowAddress.open()) : e.getLocation({
                                    type: "gcj02",
                                    success: function(e) {
                                        console.log("data2"), t.getaddress();
                                    },
                                    fail: function(t) {
                                        e.showToast({
                                            title: "请开启手机位置定位或者GPS,然后重新进入此页面",
                                            icon: "none"
                                        }), setTimeout(function() {
                                            e.reLaunch({
                                                url: "personnel_center"
                                            });
                                        }, 2e3);
                                    }
                                }) : wx.authorize({
                                    scope: "scope.userLocation",
                                    success: function() {
                                        e.getLocation({
                                            type: "gcj02",
                                            success: function(e) {
                                                console.log("data"), t.getaddress();
                                            },
                                            fail: function(t) {
                                                e.showToast({
                                                    title: "请开启手机位置定位或者GPS,然后重新进入此页面",
                                                    icon: "none"
                                                }), setTimeout(function() {
                                                    e.reLaunch({
                                                        url: "personnel_center"
                                                    });
                                                }, 2e3);
                                            }
                                        });
                                    },
                                    fail: function() {
                                        t.graceFullLoading = !1, t.$refs.ShowAddress.open();
                                    }
                                });
                            },
                            fail: function(e) {}
                        });
                    },
                    getaddress: function() {
                        var t = this;
                        this.$refs.ShowAddress.hide(), new r.AMapWX({
                            key: this.$m
                        }).getRegeo({
                            success: function(n) {
                                var r = n[0].desc, o = n[0].longitude + "," + n[0].latitude, a = t.$xSign.sign("v4personnel_center");
                                t.$xRequest.request({
                                    url: "entry/wxapp/v4personnel_center",
                                    data: {
                                        xgsign: a,
                                        action: "info",
                                        lnglat: o,
                                        address: r
                                    },
                                    success: function(e) {
                                        t.getMenu();
                                    },
                                    fail: function(t) {
                                        e.showToast({
                                            title: "获取失败，联系管理员!",
                                            icon: "none"
                                        });
                                    }
                                });
                            },
                            fail: function(t) {
                                e.getLocation({
                                    type: "gcj02",
                                    success: function(e) {},
                                    fail: function(t) {
                                        e.showToast({
                                            title: "请开启手机位置定位或者GPS,然后重新进入此页面",
                                            icon: "none"
                                        }), setTimeout(function() {
                                            e.reLaunch({
                                                url: "personnel_center"
                                            });
                                        }, 2e3);
                                    }
                                });
                            }
                        });
                    },
                    getMenu: function() {
                        var t = this, n = this.$xSign.sign("u9personnel_order");
                        this.$xRequest.request({
                            url: "entry/wxapp/u9personnel_order",
                            data: {
                                xgsign: n
                            },
                            success: function(n) {
                                var r = JSON.parse(t.$Decrypt(n.data.data));
                                t.bottomColor = r.color, -1 != r.info ? 0 == n.data.errno && (t.isRush = r.isrush, 
                                t.cardName = r.cardname, t.menuList = r.menu, t.orderItemList = r.orderItemList, 
                                t.clickNum = r.clicknum, t.page = r.page, t.loadingData = r.loadType, t.pageMore = r.pageMore, 
                                t.attach = r.attach, t.perid = r.perid, t.scrollLeft = "c" + t.ordernum, t.loadData(t.ordernum, 1)) : e.showModal({
                                    title: "温馨提示",
                                    content: n.data.message,
                                    showCancel: !1,
                                    success: function(t) {
                                        t.confirm && ("请重新填写申请资料!" == n.data.message ? e.reLaunch({
                                            url: "../editsmjz/editsmjz"
                                        }) : e.reLaunch({
                                            url: "../center/center"
                                        }));
                                    }
                                });
                            }
                        });
                    },
                    loadData: function(t, n) {
                        var r = this, o = this.menuList[t].status;
                        1 != this.pageMore[t] ? (this.tip = "请等待", 1 == n ? this.graceFullLoading = !0 : e.showLoading({
                            title: "数据加载中",
                            mask: !0
                        }), setTimeout(function() {
                            var a = r.$xSign.sign("v4personnel_order_more");
                            r.$xRequest.request({
                                url: "entry/wxapp/v4personnel_order_more",
                                data: {
                                    page: r.page[t],
                                    status: o,
                                    xgsign: a
                                },
                                success: function(o) {
                                    var a = JSON.parse(r.$Decrypt(o.data.data));
                                    if (1 == n ? r.graceFullLoading = !1 : e.hideLoading(), 0 == a.info) {
                                        if (a.itemlist) {
                                            var i = a.itemlist;
                                            r.tempItem = r.orderItemList[t].concat(a.itemlist), r.orderItemList[t] = r.tempItem, 
                                            i.length < a.pagesize ? (r.pageMore[r.tabCurrentIndex] = 1, r.loadingData.splice(r.tabCurrentIndex, 1, 2)) : (r.loadingData.splice(r.tabCurrentIndex, 1, 0), 
                                            r.clickNum[t]++, r.page[t]++);
                                        }
                                    } else r.tempPageMore = a.info, r.pageMore[t] = r.tempPageMore, r.loadingData.splice(r.tabCurrentIndex, 1, 2);
                                    0 == r.orderItemList.length && (r.tip = "没有相关订单");
                                }
                            });
                        }, 1e3)) : 1 == n ? this.graceFullLoading = !1 : e.hideLoading();
                    },
                    tabClick: function(e) {
                        this.tabCurrentIndex = e.currentTarget.dataset.cindex;
                    },
                    changeTab: function(e) {
                        this.tabCurrentIndex = e.target.current;
                        var t = e.target.current;
                        this.scrollLeft = "c" + t, 0 == this.clickNum[t] && this.loadData(t, 1);
                    },
                    toDetail: function(t) {
                        e.navigateTo({
                            url: "/xg_o2o/personnel/personnel_order_detail?oid=" + t + "&pid=" + this.perid
                        });
                    },
                    copyId: function(t) {
                        e.setClipboardData({
                            data: t,
                            success: function() {
                                console.log("success");
                            }
                        });
                    },
                    dateToStr: function(e) {
                        var t = 1e3 * parseInt(e), n = new Date(t), r = n.getFullYear(), o = n.getMonth() + 1, a = n.getDate(), i = n.getHours(), s = n.getMinutes();
                        return n.getSeconds(), r + "-" + (String(o).length > 1 ? o : "0" + o) + "-" + (String(a).length > 1 ? a : "0" + a) + " " + (String(i).length > 1 ? i : "0" + i) + ":" + (String(s).length > 1 ? s : "0" + s);
                    },
                    payresult: function(e, t) {
                        var n = parseFloat(e) + parseFloat(t);
                        return Math.round(100 * n) / 100;
                    }
                },
                computed: {
                    style: function() {
                        var t = this.$systemInfo.info(), n = t.windowHeight - t.iPhoneXBottomHeightPx - t.statusBarHeight - 44 - e.upx2px(170);
                        return "height:".concat(n, "px;");
                    }
                }
            };
            t.default = o;
        }).call(this, n("543d").default);
    },
    "6b8d": function(e, t, n) {
        "use strict";
        n.r(t);
        var r = n("504d"), o = n.n(r);
        for (var a in r) "default" !== a && function(e) {
            n.d(t, e, function() {
                return r[e];
            });
        }(a);
        t.default = o.a;
    },
    "847f": function(e, t, n) {
        "use strict";
        n.r(t);
        var r = n("8d55"), o = n("6b8d");
        for (var a in o) "default" !== a && function(e) {
            n.d(t, e, function() {
                return o[e];
            });
        }(a);
        n("b28a");
        var i = n("f0c5"), s = Object(i.a)(o.default, r.b, r.c, !1, null, null, null, !1, r.a, void 0);
        t.default = s.exports;
    },
    "8d55": function(e, t, n) {
        "use strict";
        n.d(t, "b", function() {
            return o;
        }), n.d(t, "c", function() {
            return a;
        }), n.d(t, "a", function() {
            return r;
        });
        var r = {
            gracePage: function() {
                return n.e("graceUI/components/gracePage").then(n.bind(null, "1915"));
            },
            graceDialog: function() {
                return n.e("graceUI/components/graceDialog").then(n.bind(null, "8d15"));
            },
            graceEmptyNew: function() {
                return n.e("graceUI/components/graceEmptyNew").then(n.bind(null, "fb2f"));
            },
            divider: function() {
                return n.e("components/divider/divider").then(n.bind(null, "bdb7"));
            },
            graceLoading: function() {
                return n.e("graceUI/components/graceLoading").then(n.bind(null, "93a5"));
            },
            xgTabbarPer: function() {
                return n.e("components/xgTabbarPer/xgTabbarPer").then(n.bind(null, "534a"));
            }
        }, o = function() {
            var e = this, t = (e.$createElement, e._self._c, 0 !== e.menuList.length ? e.__map(e.orderItemList, function(t, n) {
                return {
                    $orig: e.__get_orig(t),
                    l0: e.__map(t, function(t, n) {
                        var r = e.__get_orig(t), o = t.isdemand > 0 || 1 == t.isadminadd && t.marketprice > 0 || 1 == t.isadminadd && t.needprice > 0 || 0 != t.isdemand || 0 != t.isadminadd ? null : e.floatAdd(t.marketprice, t.totalprice), a = e.payresult(t.materialprice, t.serviceprice);
                        return {
                            $orig: r,
                            m0: o,
                            m1: a,
                            m2: a > 0 ? e.payresult(t.materialprice, t.serviceprice) : null,
                            m3: e.dateToStr(t[t.status.status_time.time])
                        };
                    })
                };
            }) : null);
            e.$mp.data = Object.assign({}, {
                $root: {
                    l1: t
                }
            });
        }, a = [];
    },
    a6a5: function(e, t, n) {
        "use strict";
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            n("4e1e"), t(n("66fd")), e(t(n("847f")).default);
        }).call(this, n("543d").createPage);
    },
    b28a: function(e, t, n) {
        "use strict";
        var r = n("0163");
        n.n(r).a;
    }
}, [ [ "a6a5", "common/runtime", "common/vendor" ] ] ]);